/**
 * 项目入口文件
 */

//引入vue
import Vue from 'vue';

//引入路由包
import VueRouter from 'vue-router'
Vue.use(VueRouter);

//引入jQuery
import $ from 'jquery';

//引入根组件
import App from '../App.vue'

//引入mint-ui包
import MintUi from 'mint-ui'
Vue.use(MintUi)

//引入ajax包
import VueRsc from 'vue-resource'
Vue.use(VueRsc)

//引入自定义组件
import HomeComponent from '../components/homeComponent.vue'
import TeacherComponent from '../components/teacher/teacherComponent.vue'
import CategoryComponent from '../components/category/categoryComponent.vue'
import AddLessonComponent from '../components/lesson/addLessonComponent.vue'
import LessonListComponent from '../components/lesson/lessonListComponent.vue'
import LoginComponent from '../components/loginComponent.vue'
import UserCenterComponent from '../components/userCenterComponent.vue'
import AddTeacherComponent from '../components/teacher/addTeacherComponent.vue'
import EditTeacherComponent from '../components/teacher/editTeacherComponent.vue'
import EditCategoryComponent from '../components/category/editCategoryComponent.vue'
import AddCategoryComponent from '../components/category/addCategoryComponent.vue'

//引入字体图标css文件
// import '../../statics/font-awesome/css/font-awesome.min.css'

//引入css文件
import '../../statics/bootstrap/css/bootstrap.min.css'
import '../../statics/css/site.css'

import 'bootstrap'


//实例化路由对象
var router = new VueRouter({
    mode: 'history', //去掉url上面的# 页面一刷新就会出错 找不到文件
    routes: [{
            path: "/",
            redirect: "/login" //默认组件
        },
        {
            path: "/home", //home组件
            component: HomeComponent
        },
        {
            path: "/teacher",
            component: TeacherComponent
        },
        {
            path: "/category",
            component: CategoryComponent
        },
        {
            path: "/add_lesson",
            component: AddLessonComponent
        },
        {
            path: "/lesson_list",
            component: LessonListComponent
        },
        {
            path: "/login",
            component: LoginComponent
        },
        {
            path: "/user_center",
            component: UserCenterComponent
        },
        {
            path: "/teacher/add_teacher",
            component: AddTeacherComponent
        },
        {
            path: "/teacher/edit_teacher",
            component: EditTeacherComponent
        },
        {
            path: "/category/edit_category",
            component: EditCategoryComponent
        },
        {
            path: "/category/add_category",
            component: AddCategoryComponent
        }
    ]
})

//实例化vue对象
new Vue({
    el: "#app",
    router,
    render: c => c(App)
})